Skip to content

Instantly share code, notes, and snippets.

@peterhurford
peterhurford / git-101-exercises.md
Last active July 29, 2023 04:30
Git 101, with Exercises

Git 101, with Exercises

Git is the key tool we use to allow multiple people to work on the same code base. Git takes care of merging everyone's contributions smoothly. Hence, learning how to use Git is critical to contributing to open source.

Exercises

Exercise 1: Go through the Try Git Guide

Exercise 2: Learn How to file a github issue.

@talwrii
talwrii / jqcheatsheet.md
Last active December 16, 2020 15:13
jq cheatsheet

jq cheatsheet

Extract field from list of objects

jq 'map(.foo)'

[ { foo: 1 }, { foo: 2 } ]
[1, 2]
@maggit
maggit / suma_digitos.md
Last active March 1, 2023 01:41
Suma los digitos!

#Suma los digitos! Este archivo de texto tiene un montón de números, el reto es sumar todos los numeros!!!

Ejemplo (si el archivo solo tuviera los siguientes numeros):

  159375
  924
 621
@FilipLukac
FilipLukac / install_pgsql.sh
Last active November 10, 2015 20:12
Install pgsql + pdo_pgsql for Mac OS X El Capitan
PHP_VER="5.6.1"
PHP_INI="/usr/local/php5/lib/php.ini"
# Check if extension exists first
php -m | grep pgsql
# Update brew and install requirements
brew update
brew install autoconf
@vsouza
vsouza / .bashrc
Last active April 20, 2025 21:15
Golang setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell, fish or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@pkuczynski
pkuczynski / LICENSE
Last active March 14, 2025 14:12
Read YAML file from Bash script
MIT License
Copyright (c) 2014 Piotr Kuczynski
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWAR
@gwixted
gwixted / gist:4039676
Created November 8, 2012 15:55 — forked from NickTomlin/Recipes.md
Terminal Cheatsheet

Note

This contains commands shamelessly stolen from many authors. I will try to list all of them at the end of the file, but if I've missed someone, let me know.

Legend

  • UC/Use Case : a practical/frequently used example of the command in action (I find it easier to add commands into my daily workflow if I have an example that uses them in something I often do)

The Prompt


Navigating / Manipulating Text (emacs style terminal) [3]

@mhawksey
mhawksey / gist:1442370
Last active February 1, 2025 00:36
Google Apps Script to read JSON and write to sheet
function getJSON(aUrl,sheetname) {
//var sheetname = "test";
//var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json";
var response = UrlFetchApp.fetch(aUrl); // get feed
var dataAll = JSON.parse(response.getContentText()); //
var data = dataAll.value.items;
for (i in data){
data[i].pubDate = new Date(data[i].pubDate);
data[i].start = data[i].pubDate;
}
@schakko
schakko / ad_ldif_to_xml_json.php
Created March 31, 2011 16:02
Converts Active Directory LDIF schema to XML or JSON
<?php
/**
* This hack converts an Active Directory LDIF schema file to XML or JSON.
* Export Active Directory schema with the following command (must be run as Domain Administrator):
* ldifde -f SaveSchema.ldif -d CN=Schema,CN=Configuration,DC=domain,DC=local
* Change var $file to location of generated schema, open your browser, point to this file and append ?xml for XML output or ?json for JSON output
*
* @author Christopher Klein <ckl[at]ecw[dot]de>
* @url http://wap.ecw.de
*/