Skip to content

Instantly share code, notes, and snippets.

View nk-gears's full-sized avatar
💥
experimenting...

Nirmal nk-gears

💥
experimenting...
View GitHub Profile
@nk-gears
nk-gears / gist:f5d00ed882c781a58ab9
Created November 30, 2014 17:16
POST JSON from OBJ-C
NSString *queryString = [NSString stringWithFormat:@"http://chrisrisner.com/Labs/day7test.php?name=%@", [self.txtName text]];
NSMutableURLRequest *theRequest=[NSMutableURLRequest
requestWithURL:[NSURL URLWithString:
queryString]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:60.0];
NSDictionary* jsonDictionary = [NSDictionary dictionaryWithObjectsAndKeys:
@"Value1", @"Key1",
@"Value2", @"Key2",
nil];
@nk-gears
nk-gears / gist:67949dce98e4fd0f111a6797c97a1f10
Created August 29, 2016 09:59 — forked from ishikawa/gist:88599
Java Sample Code for Calculating HMAC-SHA1 Signatures
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.SignatureException;
import java.util.Formatter;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
/**
@nk-gears
nk-gears / learn-dynamodb.md
Created November 1, 2016 11:12 — forked from teohm/learn-dynamodb.md
personal reading notes about DynamoDB tips & gotcahs

Disclaimer: I'm super new to DynamoDB, so if you found I wrote something incorrect or stupid, just kindly send me a comment :)


Learn DynamoDB

  • database -> tables -> items -> attributes
  • db = a collection of tables
@nk-gears
nk-gears / appsScript_ListFilesFolders_Mesgarpour.js
Created November 16, 2016 16:35 — forked from mesgarpour/appsScript_ListFilesFolders_ver.2.js
[Google Apps Script] List all files & folders in a Google Drive folder, & write into a speadsheet
/**
* Google Apps Script - List all files & folders in a Google Drive folder, & write into a speadsheet.
* - Main function 1: List all folders
* - Main function 2: List all files & folders
*
* Hint: Set your folder ID first! You may copy the folder ID from the browser's address field.
* The folder ID is everything after the 'folders/' portion of the URL.
*
* @version 1.0
* @see https://github.com/mesgarpour
@nk-gears
nk-gears / index-spec.js
Created November 19, 2016 08:45 — forked from abruzzi/index-spec.js
E2E test in AngularJS by using protractor
describe("index page", function() {
beforeEach(function() {
browser.get("http://localhost:9999/app/index.html");
});
it("should have navigator", function() {
expect(element("#navigator")).toBeDefined();
});
it("should have input box", function() {
@nk-gears
nk-gears / convertSheet2Json.gs
Created November 28, 2016 13:40 — forked from daichan4649/convertSheet2Json.gs
spreadsheet のデータを JSON として読み込む(Google Apps Script)
function convertSheet2Json(sheet) {
// first line(title)
var colStartIndex = 1;
var rowNum = 1;
var firstRange = sheet.getRange(1, 1, 1, sheet.getLastColumn());
var firstRowValues = firstRange.getValues();
var titleColumns = firstRowValues[0];
// after the second line(data)
var lastRow = sheet.getLastRow();
@nk-gears
nk-gears / ssh_config
Created December 3, 2016 14:28 — forked from MatthieuLemoine/ssh_config
SSH config proxy host
# ~/.ssh/config
Host <custom-name>
HostName <remote-host>
User <remote-user>
Port <remote-ssh-port>
ForwardAgent yes
ProxyCommand ssh -o 'ForwardAgent yes' <proxy-user>@<proxy-host> 'ssh-add && nc %h %p'
@nk-gears
nk-gears / jenkins-ec2-continous-integration.md
Created December 11, 2016 09:00 — forked from stephenharris/jenkins-ec2-continous-integration.md
How to set up CI with Jenkins on AWS EC2 (and some notes)
package ca.uwo.csd.cs2212.USERNAME;
public class BankAccount {
private double balance;
public BankAccount(double balance) {
this.balance = balance;
}
packages:
yum:
git: []
gcc: []
make: []
openssl-devel: []
commands:
00-add-home-variable:
command: sed -i 's/function error_exit/export HOME=\/root\n\nfunction error_exit/' /opt/elasticbeanstalk/hooks/appdeploy/pre/50npm.sh
container_commands: