Skip to content

Instantly share code, notes, and snippets.

View surjikal's full-sized avatar
👁️‍🗨️

Nick Porter surjikal

👁️‍🗨️
  • CTO @ 42
  • Oakland
View GitHub Profile
@surjikal
surjikal / countries.md
Created June 10, 2025 23:52 — forked from richjenks/countries.md
ISO 3166 countries by region — AMER, EMEA & APAC
Country ISO 3166 Region
Afghanistan AF EMEA
Åland Islands AX EMEA
Albania AL EMEA
Algeria DZ EMEA
American Samoa AS APAC
Andorra AD EMEA
Angola AO EMEA
Anguilla AI AMER
@surjikal
surjikal / copy_database.sql
Created August 21, 2019 01:27
[Copy database SAP Hana] SQL command to create a copy database in SAP Hana #Hana
-- Default B1_SHF folder: /usr/sap/SAPBusinessOne/B1_SHF
-- Create a new backup
EXPORT "SBODEMOIE"."*" AS BINARY INTO '/usr/sap/NDB/HDB00/backup/data' WITH REPLACE THREADS 10;
-- Duplicate a database (but you need to create a backup before)
import "SBODEMOIE"."*" as binary from '/usr/sap/NDB/HDB00/backup/data' with ignore existing threads 10 rename schema "SBODEMOIE" to "DEMODB_1";
@surjikal
surjikal / index.html
Last active May 4, 2019 20:49 — forked from phil-pedruco/index.html
Plotting a bell (Gaussian) curve in d3
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Normal Plot</title>
<meta name="description" content="">
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<style type="text/css">
@surjikal
surjikal / index.html
Last active May 4, 2019 20:32 — forked from sirrobert/index.html
Smoothly streaming line graph
<!DOCTYPE html>
<html>
<head>
<title>Line Chart</title>
<link type="text/css" rel="stylesheet" href="line.css"/>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
</head>
<body>
<script type="text/javascript" src="line.js"></script>
</body>
@surjikal
surjikal / tweaks-commented.sh
Created September 9, 2016 23:41 — forked from Tristor/tweaks
OSX Dev Tweaks
#!/usr/bin/env bash
# Disable the sound effects on boot
sudo nvram SystemAudioVolume=" "
# Disable transparency in the menu bar and elsewhere on Yosemite
defaults write com.apple.universalaccess reduceTransparency -bool true
# Menu bar: hide the Time Machine, Volume, and User icons
for domain in ~/Library/Preferences/ByHost/com.apple.systemuiserver.*; do
defaults write "${domain}" dontAutoLoad -array \
"/System/Library/CoreServices/Menu Extras/TimeMachine.menu" \
"/System/Library/CoreServices/Menu Extras/Volume.menu" \
var app = angular.module('converter', []);
app.directive('converter', function(converters) {
return {
require: 'ngModel',
link: function(scope, element, attr, ngModel) {
var converter = converters[attr.converter];
ngModel.$formatters.unshift(converter.formatter);
ngModel.$parsers.push(converter.parser);
},
@surjikal
surjikal / nginx-cors.conf
Last active March 10, 2016 01:12 — forked from algal/nginx-cors.conf
Nginx CORS include file
#
# A CORS (Cross-Origin Resouce Sharing) config for nginx
#
# == Purpose
#
# This nginx configuration enables CORS requests in the following way:
# - enables CORS just for origins on a whitelist specified by a regular expression
# - CORS preflight request (OPTIONS) are responded immediately
# - Access-Control-Allow-Credentials=true for GET and POST requests
# - Access-Control-Max-Age=20days, to minimize repetitive OPTIONS requests
package main
import (
"flag"
"fmt"
"log"
"net/http"
"os"
)
@surjikal
surjikal / csv.js
Last active November 5, 2020 19:58 — forked from ghuntley/gist:5064790
Generating a downloadable CSV file in the browser.
// assumes variable data, which is a homogenous collection of objects
// get keys
var keys = _.keys(data[0]);
// convert to csv string
var csv = keys.join(",");
_(data).each(function(row) {
csv += "\n";
csv += _(keys).map(function(k) {
@surjikal
surjikal / README.md
Last active October 13, 2015 19:08 — forked from agnoster/README.md
My ZSH Theme

surj.zsh-theme

This is a hack of this awesome theme by agnoster.

The same instructions apply:

  • You'll probably need to install a Powerline-patched font for this theme to render correctly.
  • Optimized for iTerm2, using a modified version of the Solarized Theme (included at the bottom of this gist).