Skip to content

Instantly share code, notes, and snippets.

Avatar

Valentin Hervieu ValentinH

View GitHub Profile
@ValentinH
ValentinH / named import VSCode snippet
Created Jan 2, 2021
VSCode snippet for named-import snippet
View named import VSCode snippet
{
"Named import": {
"prefix": "ni",
"body": [
"import {$2} from '$1'"
],
"description": "Named import"
}
}
View index.js
function decryptBigIpCookie(cookieValue) {
const [ipPart, portPart] = cookieValue.split('.')
const hexIp = parseInt(ipPart, 10)
.toString(16)
.padStart(8, '0')
const ip1 = parseInt(hexIp.toString().substring(6, 8), 16)
const ip2 = parseInt(hexIp.toString().substring(4, 6), 16)
const ip3 = parseInt(hexIp.toString().substring(2, 4), 16)
const ip4 = parseInt(hexIp.toString().substring(0, 2), 16)
@ValentinH
ValentinH / Stylefile.yml
Created Aug 3, 2018
Customizations for www.ricardo.ch via StyleURL.
View Stylefile.yml
---
version: 1.0
domains:
- www.ricardo.ch
url_patterns:
- www.ricardo.ch/*
timestamp: '2018-08-03T18:06:21Z'
id: vts2
redirect_url: https://www.ricardo.ch/fr/a/schoene-ohrstecker-1001262266/
shared_via: StyleURL - (https://www.styleurl.app) import and export CSS changes from
@ValentinH
ValentinH / Stylefile.yml
Created Aug 3, 2018
Customizations for www.ricardo.ch via StyleURL.
View Stylefile.yml
---
version: 1.0
domains:
- www.ricardo.ch
url_patterns:
- www.ricardo.ch/*
timestamp: '2018-08-03T17:57:07Z'
id: k5bL
redirect_url: https://www.ricardo.ch/fr/a/schoene-ohrstecker-1001262266/
shared_via: StyleURL - (https://www.styleurl.app) import and export CSS changes from
@ValentinH
ValentinH / queryTwitter.php
Created Jan 5, 2014
How to query Twitter search API in PHP. This example shows how to query a hashtag and get the top 100 more recent results. * require CURL.
View queryTwitter.php
function queryTwitter($search)
{
$url = "https://api.twitter.com/1.1/search/tweets.json";
if($search != "")
$search = "#".$search;
$query = array( 'count' => 100, 'q' => urlencode($search), "result_type" => "recent");
$oauth_access_token = "ABCD";
$oauth_access_token_secret = "1234";
$consumer_key = "abcd";
$consumer_secret = "5678";