working on it ...

Filters

Explore Public Snippets

Sort by

Found 1,822 snippets

    public by passh modified Oct 19, 2016  10072  8  4  1

    HTML TWIG TEMPLATE BASIC

    basic twig html template
    {# HTML TEMPLATE TWIG TEMPLATE BASIC by Passh#}
    <!DOCTYPE HTML>
    
    <html lang="es">
    	<body>
    
    			<head>
    					<meta charset="utf-8" />
    					<title>
    							{% block titulo %} 
    								HTML TWIG TEMPLATE
    							{%endblock%}
    					</title>
    			</head>
    	</body>
    	<footer>by Passh</footer>
    </html>

    public by Thomas Callahan modified Jul 12, 2016  1733  0  3  0

    Basic Alert Box using JS

    Basic Alert Box using JS: Basic alert
    <!DOCTYPE html>
    <html>
    <body>
    
    	<p>Click the button to display an alert box.</p>
    
    	<button onclick="myFunction()">Click me</button>
    
    	<script>
    		function myFunction() {
    			
    			alert("I am an alert box!");
    			
    		}
    	</script>
    
    </body>
    </html>
    
    

    public by congruityservice modified Oct 7, 2015  1803  2  5  0

    Simple OpenInsight Response Dialog

    Uses the Msg function to display a dialog prompting the user to enter a response. See the Msg function in OpenInsight help file for more information.
    $Insert MSG_EQUATES
    
    Def = ""
    Def<MTEXT$> = "What did you eat for breakfast?"
    Def<MTYPE$> = "RC"
    Def<MICON$> = "?"
    
    Response = Msg(@window, Def)
    
    if Response = char(27) or Response = "" then
       * Message was escaped or not entered
       Return
    end

    public by congruityservice modified Aug 29, 2015  2130  2  6  0

    ReadNext Loop with Read and Write

    Basic ReadNext loop through an entire table with a read and write of each record.
    Subroutine CS_SNIP_ReadNext_ReadWrite(void)
    
    declare function Set_FSError
    $Insert Logical
    
    *Change to the name of the table to ReadNext through
    TABLE_NAME = "CUSTOMERS"
    
    open TABLE_NAME To TABLE else
    	status = Set_FSError()
    	return
    end
    
    select TABLE
    Done = False$
    
    Loop
    	ReadNext @ID else Done = True$
    Until Done Do
    
    	read @RECORD From TABLE, @ID Then
    		
    		Gosub processRecord
    		
    		Write @RECORD To TABLE, @ID Else
    			status = Set_FSError()
    			return
    		End
    		
    	End Else
    		status = Set_FSError()
    		return
    	End
    	
    Repeat
    
    return
    *
    * End Main
    *
    processRecord:
    
    	//Add your processing to @RECORD here
       
    return
    	            

    public by Uriahs modified Jul 1, 2015  2109  1  6  0

    Change default VS webbrowser render engine

    Perfect for websites sending out js errors !
    create a form called Form1 or just name accordingly, delete everything with its code and paste with below, now you will be surfing using the current installed IE   
    
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            CreateBrowserKey()
           
    'Below code adds a custom useragent, adding a custom useragent does not change the actual engine...thats why we need to do all this coding.
    WebBrowser1.Navigate("http://www.whatsmybrowser.org", "_top", Nothing, "User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36")
    
    'This goes to the website using default user agent.
       'WebBrowser1.Navigate("http://www.whatsmybrowser.org")
    
        End Sub
    
        Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As FormClosingEventArgs) Handles Me.FormClosing
            RemoveBrowerKey()
        End Sub
        Private Const BrowserKeyPath As String = "\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION"
        Private Sub CreateBrowserKey(Optional ByVal IgnoreIDocDirective As Boolean = False)
            Dim basekey As String = Microsoft.Win32.Registry.CurrentUser.ToString
            Dim value As Int32
            Dim thisAppsName As String = My.Application.Info.AssemblyName & ".exe"
            ' Value reference: http://msdn.microsoft.com/en-us/library/ee330730%28v=VS.85%29.aspx
            ' IDOC Reference:  http://msdn.microsoft.com/en-us/library/ms535242%28v=vs.85%29.aspx
            Select Case (New WebBrowser).Version.Major
                Case 8
                    If IgnoreIDocDirective Then
                        value = 8888
                    Else
                        value = 8000
                    End If
                Case 9
                    If IgnoreIDocDirective Then
                        value = 9999
                    Else
                        value = 9000
                    End If
                Case 10
                    If IgnoreIDocDirective Then
                        value = 10001
                    Else
                        value = 10000
                    End If
    
                Case 11
                    If IgnoreIDocDirective Then
                        value = 11001
                    Else
                        value = 11000
                    End If
                Case Else
                    Exit Sub
            End Select
            Microsoft.Win32.Registry.SetValue(Microsoft.Win32.Registry.CurrentUser.ToString & BrowserKeyPath, _
                                              Process.GetCurrentProcess.ProcessName & ".exe", _
                                              value, _
                                              Microsoft.Win32.RegistryValueKind.DWord)
        End Sub
        Private Sub RemoveBrowerKey()
            Dim key As Microsoft.Win32.RegistryKey
            key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(BrowserKeyPath.Substring(1), True)
            key.DeleteValue(Process.GetCurrentProcess.ProcessName & ".exe", False)
        End Sub
    
    End Class

    public by Uriahs modified Jun 29, 2015  310190  1  6  0

    Move borderless form VB.NET

    Code to move a borderless winform which is not moveable by default
    Dim drag As Boolean
       Dim mousex As Integer
       Dim mousey As Integer
       Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
           drag = True 'Sets the variable drag to true.
           mousex = Windows.Forms.Cursor.Position.X - Me.Left 'Sets variable mousex
           mousey = Windows.Forms.Cursor.Position.Y - Me.Top 'Sets variable mousey
       End Sub
    
       Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
           'If drag is set to true then move the form accordingly.
           If drag Then
               Me.Top = Windows.Forms.Cursor.Position.Y - mousey
               Me.Left = Windows.Forms.Cursor.Position.X - mousex
           End If
       End Sub
    
       Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp
           drag = False 'Sets drag to false, so the form does not move according to the code in MouseMove
       End Sub
    

    public by congruityservice modified Jun 25, 2015  2004  1  5  0

    RDK View Import Export Code

    Function for exporting a list of RDK entries to an OS file and then re-importing it, perhaps into a different OpenInsight system.
    Subroutine CS_RDKView(Action, View, Path)
    /*Usage:
    *To export a view named SCRATCH
    run CS_RDKView "Export", "SCRATCH", "D:\TEMP"
    
    *Import a view named SCRATCH from the TEMP folder
    Run CS_RDKView "Import", "SCRATCH", "D:\TEMP"
    */
    Declare Subroutine Copy_row_to_os, Copy_OS_To_Row
    
    Convert @LOWER_CASE To @UPPER_CASE In View
    Key = @DBID<1>:"*":View
    OSFile = Path : "\" : View : "_viewexport.txt"
    Table = "SYSREPOSVIEWS"
    AlwaysOverwrite = 2
    AlwaysConvert = 0
    NoLocking = 0
    	
    If Action _EQC "Export" Then
    	
    	Call Copy_Row_to_os(Table,Key,OSFile,AlwaysOverwrite,AlwaysCOnvert,NoLocking)
    
    End
    
    If Action _EQC "Import" Then
    
    	Copy_OS_To_ROW(OSFile,Table, Key, AlwaysOverwrite, AlwaysCOnvert,NoLocking)
    
    End
    
    Return 

    public by congruityservice modified Jun 21, 2015  1910  1  5  0

    Move Control Over Placeholder Control

    The snippet moves one control over another control. Useful if you need to design a form with place holders and then move the actual field onto that placeholder.
    *Move TXT_FNAME edit line over the LBL_PLACEHOLDER1 label.
    pcopTarget = @WINDOW:".LBL_PLACEHOLDER1"
    pcopSource = @WINDOW:".TXT_FNAME"
    Gosub PlaceControlOverPlaceholder
    
    *
    * Sub moves control over the specified placeholder control
    *
    PlaceControlOverPlaceholder:
    	*Acronym
    	*pcop - Place Control Over Placeholder
    
    	If Unassigned(pcopOffset_X) Then pcopOffset_X = 0
    	If Unassigned(pcopOffset_Y) Then pcopOffset_Y = 0
    
    	pcopS = Get_Property(pcopSource,'SIZE')
    	pcopT = Get_Property(pcopTarget,'SIZE')
    
    	pcopS<1> = pcopT<1> + pcopOffset_X ;* X
    	pcopS<2> = pcopT<2> + pcopOffset_Y	;* Y
    	*S<3> = 100 ;* Width
    	*S<4> = 20	;* Height
    
    	Call Set_Property(pcopSource,'SIZE', pcopS)
    
    	Call Set_Property(pcopSource,"VISIBLE", 0)
    	Call Set_Property(pcopTarget,"VISIBLE", 1)
    
    	pcopOffset_X = 0
    	pcopOffset_Y = 0
    
    Return
    *
    * End PlaceControlOverPlaceholder
    *
                

    public by congruityservice modified Jun 21, 2015  2717  3  5  0

    Delete All Selected Records from TCL

    Compile and use this routine to delete all records currently selected from a TCL SELECT statement.
    Subroutine CS_DeleteSelected(TableName)
    $Insert Logical
    
    /*
    To use:
    1) Compile this routine If Not previously compiled.
    2) From TCL, Select records. I.e. Select CUSTOMERS With LNAME = 'BADDATA'
    3) From TCL, RUN CS_DeleteSelected
    A message box will display indicating number of records deleted.
    */
    
    open TableName to Table Else
    	Call Msg("Couldn't open table " : TableName)
    	Return
    End
    
    CounterSuccess = 0
    CounterFail = 0
    done = FALSE$
    loop
    	readnext @ID Else Done = TRUE$
    until done
    	read Rec from Table, @ID then
    
    		delete Table, @ID Then 
    			CounterSuccess += 1
    		End Else
    			CounterFail += 1
    		End	
    
    	end
    repeat
    
    Call Msg("Deleted " : CounterSuccess : " recs from " : TableName : "|" : CounterFail : " could not be deleted")
    
    Return
    *
    *End Main
    *

    public by gonelf modified May 23, 2014  2495  1  5  1

    iOS tableview basic functions

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    {
        return [allCategories count];
    }
    
    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
        return 54;
    }
    
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
        // select this skills
    }
    
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
        static NSString *simpleTableIdentifier = @"feedCell";
        
        feedTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
        
        return cell;
    }
    • Public Snippets
    • Channels Snippets