This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MagicStruct | |
include ActiveModel::Validations | |
def initialize(hashish) | |
hashish.each do |key, val| | |
send(:"#{key}=", val) | |
end | |
end | |
def self.required_params(*required_keys) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('i am running the handler binder'); | |
$(function(event) { | |
console.log('I am running the redirector'); | |
window.location.replace( "https://www.patreon.com/bePatron?c=947861"); | |
}); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// types.js | |
const REPORTER_PENDING_REPORT_UPDATE = "[reporter] pending report update" | |
// actions/reporter.js | |
export function reporterPendingReportUpdate() { | |
return { type: types.REPORTER_PENDING_REPORT_UPDATE } | |
} | |
// components/PromptHarm.js | |
import reporterActions from 'actions/reporter' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// types.js | |
const REPORTER_PENDING_REPORT_UPDATE = "[reporter] pending report update" | |
// components/PromptHarm.js | |
import types from 'types' | |
const PromptHarm = ({dispatch}) => ( <PromptContainer> | |
<PromptText>Is anyone at risk of immediate harm to themselves or others?</PromptText> | |
<PromptButtonsContainer> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// types.js | |
const REPORTER_PENDING_REPORT_UPDATE = "[reporter] pending report update" | |
// actions/reporter.js | |
const simpleActionCreatorProxy = new Proxy(module.exports, { | |
get (target, key) { | |
const actionName = camelToUnderscore(key).toUpperCase() | |
if (key in target) { | |
return target[key] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'set +e' > /tmp/script.sh && echo 'mkdir -p "$HOME/Dropbox/Voice Memos"' >> /tmp/script.sh && sqlite3 ~/Library/Application\ Support/com.apple.voicememos/Recordings/CloudRecordings.db "select 'cp -n \"' || zpath || '\" \"$HOME/Dropbox/Voice Memos/' || zcustomlabel || '.m4a\"; touch -t '||strftime('%Y%m%d%H%M', datetime(zdate + strftime('%s','2001-01-01'), 'unixepoch'))||' \"$HOME/Dropbox/Voice Memos/' || zcustomlabel || '.m4a\"' from zcloudrecording;" >> /tmp/script.sh; bash -v /tmp/script.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let final = "" | |
for (let el in styles ) { | |
const tagName = el.charAt(0).toUpperCase() + el.slice(1) | |
const rules = styles[el] | |
const transformedRules = Object.keys(rules).map( ruleName => { | |
const cssRule = ruleName.replace( /([a-z])([A-Z])/g, '$1-$2' ).toLowerCase(); | |
const convertedStyle = ` ${cssRule}: ${rules[ruleName]};` | |
return convertedStyle | |
}).join("\n") | |
const finalComponent = `const ${tagName} = styled(View)\` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// usage "node index.js /path/to/your/project.als" | |
const path = require('path') | |
const fs = require('fs') | |
const Ableton = require('ableton') //https://github.com/CocoFox/ableton | |
const [_,__,projectPath] = process.argv | |
const project = new Ableton(projectPath) | |
const main = async () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
font-family: helvetica, sans-serif; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log(JSON.stringify([...document.querySelectorAll(".react-list-page__star-rating-total")].map(el => [parseInt(el.innerText.replace(/[^0-9]/g,'')), el.parentNode.parentNode.querySelector(".react-list-page__product-title").innerText]).sort( (a,b) => b[0]-a[0]), null, 4)) |