Skip to content

Instantly share code, notes, and snippets.

View CKGrafico's full-sized avatar
🎈

Quique Fdez Guerra CKGrafico

🎈
View GitHub Profile
{
"window.zoomLevel": 0,
"editor.fontSize": 14,
"editor.renderWhitespace": "boundary",
"workbench.iconTheme": "vscode-great-icons",
"editor.minimap.enabled": true,
"stylelint.enable": true,
"css.validate": false,
"scss.validate": false,
"tslint.autoFixOnSave": true,
@CKGrafico
CKGrafico / jquery-development-tools.js
Created March 2, 2019 19:56
Add jQuery to Developer tools
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
@CKGrafico
CKGrafico / bitly-checks.js
Created March 2, 2019 19:57
Click all bit.ly checkboxes in user portal
cki = 0;
jQuery('.checkmark-icon.checkbox-icon').each((i, $check) => {
if (cki === 95) {return}
const count = jQuery($check).parent().parent().parent().find('.click-count--MAIN');
const num = parseInt(count.text(), 10);
if (num < 2) {
jQuery($check).click();
cki++;
}
})
@CKGrafico
CKGrafico / default.conf
Last active March 6, 2020 00:37
wordpress-nginx-azure
# Add custom rules
upstream php {
server unix:/var/run/php/php7.0-fpm.sock;
#server 127.0.0.1:9000;
}
# BEGIN fastcgi
fastcgi_cache_path /home/nginx-fastcgi-cache levels=1:2 keys_zone=BLOGWORDPRESS:100m inactive=60m;
@CKGrafico
CKGrafico / example.hook.ts
Created July 2, 2020 14:51
Example Frontend Boilerplates Store
import { useExampleStore, ExampleStoreType } from '~/store';
export function useExample() {
// You can use stores directly form components, this is only an example of hook
const [state, dispatch] = useExampleStore();
function incrementProperty1() {
dispatch({
type: ExampleStoreType.ADD_TO_FIRST,
payload: 10
@CKGrafico
CKGrafico / colors.helper.ts
Created January 10, 2022 10:24
Generate cool random colors with foreground and background labels
// Code from https://gist.github.com/mjackson/5311256
function hue2rgb(p: number, q: number, t: number) {
if (t < 0) t += 1;
if (t > 1) t -= 1;
if (t < 1 / 6) return p + (q - p) * 6 * t;
if (t < 1 / 2) return q;
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
return p;
}