Skip to content

Instantly share code, notes, and snippets.

View disusered's full-sized avatar

Carlos Rosquillas disusered

View GitHub Profile
@disusered
disusered / lindns.sh
Created May 2, 2011 19:51
Linode Dynamic DNS
# update our entry with our ip
wget -qO- https://api.linode.com/?api_key=KEY\&api_action=domain.resource.update\&domainid=DOMAINID\&resourceid=RESOURCEID\&Target="[remote_addr]"
#
# in case you don't have your Domain ID on hand, you would need to run the following command first:
# wget -qO- https://api.linode.com/?api_key=APIKEY\&api_action=domain.list | tr ',' '\n'```
#
# afterwards, we can get the ResourceID via:
# wget -qO- https://api.linode.com/?api_key=APIKEY\&api_action=domain.resource.list\&domainid=DOMAINID| tr ',' '\n'```
#
@disusered
disusered / Gemfile
Created September 27, 2011 04:47
LiveReload, Compass, Sprockets & JSMin with Guard
source "http://rubygems.org"
# Rake
gem 'rake'
gem 'guard-shell'
# Sprockets
gem 'sprockets','~> 1.0.2'
# JSMin
@disusered
disusered / .slate
Last active December 23, 2015 18:49
Slate configuration
# ---------------------------------
# Config
# ---------------------------------
config defaultToCurrentScreen true
config checkDefaultsOnLoad true
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Shows app icons and background apps, spreads icons in the same place.
config windowHintsIgnoreHiddenWindows false
@disusered
disusered / dnsimple
Created November 11, 2013 00:20
Update DNSimple with local IP
#!/bin/bash
# JSON Parser
JSON=`curl -s -X GET http://jsonip.com/`
PROP='ip'
function jsonval {
temp=`echo $JSON | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $PROP`
echo ${temp##*|}
}
@disusered
disusered / profiler
Created July 13, 2015 05:06
Profiling Neovim startup
#!/bin/bash
iterations=10
# -----------------------------------------------------------------------------
# Create array of results
declare -a results
for i in $(seq 1 $iterations);

Keybase proof

I hereby claim:

  • I am disusered on github.
  • I am disusered (https://keybase.io/disusered) on keybase.
  • I have a public key ASDpgD3vf6Ewt-zpBJ8oKvO-lYCM5Jci60gSmO_bZnY6kAo

To claim this, I am signing this object:

@disusered
disusered / error.json
Created December 7, 2018 17:23
error
{
"errors": [
{
"reason": "invalidQuery",
"location": "query",
"message": "Syntax error: Unexpected \"-\" at [1:25]"
}
],
"response": {
"kind": "bigquery#job",
## Batch Create Assertion Duplicate
curl -X "POST" "http://localhost:4000/api/batch/assertions" \
-H 'Content-Type: application/json; charset=utf-8' \
-H 'Cookie: jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJjYXJsb3NAYmFkZ2V0cmVlLmNvbSIsImlkIjoyfQ.yL0nNX_l3VtPjgZdVk7-1Q7TD4XF_IiVk2VgwhwoOqs; ueberauth_linkedin_state=INKFNIWeDa6TbzGP9aI/VA==' \
-d $'{
"data": [
{
"issuer_id": "4",
"user_email": "diego@edvolution.io",
"message": "Mensaje",
@disusered
disusered / config_loader.ex
Created June 7, 2019 17:17
Update ConfigLoader
defmodule Sphingi.ConfigLoader do
defp parse(value) when is_atom(value), do: value |> to_string
defp parse(value), do: value
def get(namespace, value, key \\ nil) do
if key do
parse(Application.get_env(namespace, value)[key])
else
parse(Application.get_env(namespace, value))
/**
* Here we have a component with a useEffect hook. Even though we've told React
* that the hook should only fire when firstHookDependency or secondHookDependency change,
* React is still going to fire this hook on every render. Explain in a few sentences how you would rewrite
* firstHookDependency and secondHookDependency to ensure that the useEffect hook only fires
* when these values change.
* */
const Component = () => {
// Function is recreated on every render, useCallback memoizes the callback. Alternatively, based on the
// function's dependencies it may be hoisted outside the component