Skip to content

Instantly share code, notes, and snippets.

View kapziel's full-sized avatar

Si Jarvis kapziel

View GitHub Profile
@tamiroze
tamiroze / sql2sf.py
Last active May 13, 2024 20:06
Converts Oracle, SQL-Server, and other DDL to Snowflake DDL
#!/usr/bin/python
# $Id: $
# Converts Oracle, SQL-Server, and other DDL to Snowflake DDL
def usage():
print """\
# Usage: sql2sf.py input-file [output-file]
"""
@jehugaleahsa
jehugaleahsa / loc.ps1
Created August 18, 2017 17:27
A simple PowerShell script to count the lines of code in a solution
$path = "C:\path\to\solution\folder"
$files = Get-ChildItem -Path $path -Include *.cs,*.ts,*.vb -Recurse `
| ? { $_.FullName -notmatch ".*\\obj\\.*" } `
| ? { $_.FullName -notmatch ".*\\node_modules\.*" }
$shortNames = $files | % {
$fullName = $_.FullName
$lines = [System.IO.File]::ReadAllLines($fullName)
$lines = $lines | ? { -not [System.String]::IsNullOrWhiteSpace($_) }
@gka
gka / plot.png
Last active April 5, 2024 03:02
visualize git logs accross multiple repositories
plot.png
@cirrusUK
cirrusUK / .Xresources
Last active April 3, 2024 11:19
termite emulator orange theme and other stuff
! __ ___ __ ___ ___ ___ _ _ _ __ ___ ___ ___
! \ \/ / '__/ _ \/ __|/ _ \| | | | '__/ __/ _ \/ __|
! _ > <| | | __/\__ \ (_) | |_| | | | (_| __/\__ \
!(_)_/\_\_| \___||___/\___/ \__,_|_| \___\___||___/
!
!## Colors
#define S_base03 #191919
#define S_base02 #073642
#define S_base01 #586e75
#define S_base00 #657b83
import java.security.*;
import java.util.*;
static class Utils {
static void saveImage(PApplet applet) {
int i = 0;
File file = null;
String fileName = null;
do {
i++;
@miguelgrinberg
miguelgrinberg / pycon-views.py
Last active September 18, 2022 05:41
Generate statistics about PyCon 2014 videos
import argparse
import re
from multiprocessing.pool import ThreadPool as Pool
import requests
import bs4
root_url = 'http://pyvideo.org'
index_url = root_url + '/category/50/pycon-us-2014'
@gwenshap
gwenshap / gist:11408870
Created April 29, 2014 18:57
generate table from Avro schema
#!/usr/bin/python
import json
import argparse
def convertType(type):
if type=="long":
return "bigint"
else:
return type
@aras-p
aras-p / preprocessor_fun.h
Last active May 13, 2024 15:42
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 13, 2024 22:10
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname