Skip to content

Instantly share code, notes, and snippets.

View ewnd9's full-sized avatar
💭
Working

ewnd9

💭
Working
View GitHub Profile
This file has been truncated, but you can view the full file.
BEGIN TRANSACTION;
CREATE TABLE [ios] (
[ios] TEXT,
[path] TEXT,
[parent] TEXT,
[filename] TEXT,
[languages] TEXT
);
INSERT INTO "ios" VALUES('iOS1','/Applications/Calculator.app/Calculator','/Applications/Calculator.app','Calculator','["Objective-C"]');
INSERT INTO "ios" VALUES('iOS1','/Applications/DemoApp.app/DemoApp','/Applications/DemoApp.app','DemoApp','["Objective-C"]');
@Deathspike
Deathspike / Controller.ts
Last active March 28, 2023 08:06
nestjs response validation example (using express)
import * as app from '.';
import * as api from '@nestjs/common';
@api.Controller()
export class TestController {
@api.Get()
@app.ResponseValidator(app.TestDto)
get() {
return new app.TestDto();
}
@konsumer
konsumer / lspci_osx.js
Created February 11, 2019 23:34
An OSX parser for `ioreg` that will get you vendor/device ID and name of devices on PCI bus
const { spawn } = require('child_process')
const Xml = require('xml-stream')
const fetch = require('node-fetch')
const cheerio = require('cheerio')
// apple returns IDs in funny order
const unmangleID = string => {
if (string) {
const s = string.split('').slice(0, 4)
return `${s[2]}${s[3]}${s[0]}${s[1]}`
@tzkmx
tzkmx / .babelrc
Last active January 20, 2023 01:50
NestJS as sub app of express.js vanilla
{
"presets": [
["env", { "targets": {"node": "current" }, "debug": true }],
"stage-0"
],
"plugins": [
"transform-decorators-legacy",
"transform-runtime"
]
@swyxio
swyxio / 1.md
Last active February 8, 2024 22:30
Learn In Public - 7 opinions for your tech career

2019 update: this essay has been updated on my personal site, together with a followup on how to get started

2020 update: I'm now writing a book with updated versions of all these essays and 35 other chapters!!!!

1. Learn in public

If there's a golden rule, it's this one, so I put it first. All the other rules are more or less elaborations of this rule #1.

You already know that you will never be done learning. But most people "learn in private", and lurk. They consume content without creating any themselves. Again, that's fine, but we're here to talk about being in the top quintile. What you do here is to have a habit of creating learning exhaust. Write blogs and tutorials and cheatsheets. Speak at meetups and conferences. Ask and answer things on Stackoverflow or Reddit. (Avoid the walled gardens like Slack and Discourse, they're not public). Make Youtube videos

@androidfred
androidfred / advanced_anki_deck_editing.md
Last active April 27, 2024 04:25
Advanced Anki deck editing made simple (ish)

Advanced Anki deck editing made simple (ish)

Anki is a great open source flashcard app that can be used to learn anything.

This Gist is a full end to end example of how to:

  • export Anki decks from Anki
  • import Anki decks into MySQL
  • edit Anki decks using MySQL
  • export Anki decks from MySQL
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@horiacristescu
horiacristescu / bookmarklet.js
Last active April 3, 2018 04:48
Text to Speech Bookmarklet
Make a bookmarklet with this code:
javascript:!function(e){function t(u){if(n[u])return n[u].exports;var r=n[u]={exports:{},id:u,loaded:!1};return e[u].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){function u(){}function r(e){console.log("pageX",e.pageX,"pageY",e.pageY),T("#speaker").css({left:e.pageX-T("#speaker").width()/2+15,top:e.pageY-T("#speaker").height()/2+15,display:"block",width:"100px",height:"100px","margin-left":"-30px","margin-top":"-30px",opacity:"1"}),T("#speaker").each(function(e,t){T(t).animate({opacity:0,left:"+="+T(t).width()/4,top:"+="+T(t).height()/4,height:0,width:0},500,function(){T(t).hide()})})}function i(e,t,n){if("SCRIPT"!=e.tagName&&"math"!=e.tagName&&"CODE"!=e.tagName&&"BUTTON"!=e.tagName&&"STYLE"!=e.tagName&&"ASIDE"!=e.tagName&&"PRE"!=e.tagName){var u=T(e).css("float"),r="left"==u||"right"==u;if(!(T(e).width()<500&&r)){if(e.classList)for(var o=0;o<e.classList.length;o++){if("word"==e.classList[o]||"MathJax"==e.clas
@paulirish
paulirish / server-timing-demo.js
Last active January 14, 2024 13:22
Demo of server timing values. visualized in chrome devtools
// see for screenshot:
// https://twitter.com/paul_irish/status/829090506084749312
const http = require('http');
function requestHandler(request, response) {
const headers = {
'Server-Timing': `
sql-1;desc="MySQL lookup Server";dur=100,
sql-2;dur=900;desc="MySQL shard Server #1",