Skip to content

Instantly share code, notes, and snippets.

View chirag64's full-sized avatar

Chirag Bhatia chirag64

View GitHub Profile
@rain-1
rain-1 / GPT-4 Reverse Turing Test.md
Last active April 16, 2024 23:19
GPT-4 Reverse Turing Test

The reverse turing test

I asked GPT-4 to come up with 10 questions to determine if the answerer was AI or human.

I provided my own answers for these questions and I also asked ChatGPT to answer them.

The result is that GPT-4 was able to correctly differentiate between AI and Human.

package org.ygl.openrndr.demos
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.color.mix
import org.openrndr.draw.BlendMode
import org.openrndr.draw.DrawPrimitive
import org.openrndr.draw.VertexElementType
import org.openrndr.draw.renderTarget
import org.openrndr.draw.shadeStyle
@bushidocodes
bushidocodes / wasm-summit-2020-notes.md
Last active July 30, 2020 23:47
WebAssembly Summit 2020 Notes

WebAssembly Summit 2020

https://webassembly-summit.org/

Lin Clark's Talk - "WebAssembly Nanoprocess"

https://www.youtube.com/watch?v=IBZFJzGnBoU

  • the missing functionality alongside WASI and Interface Types is something that provides "capability-based security".
  • Delegation of permissions to propagate down transitive dependencies
  • plan to use fine-grain form of per-module virtualization
  • A "WebAssembly nanoprocess" is just wasm, but follows a particular pattern.
@andyrbell
andyrbell / scanner.sh
Last active April 5, 2024 09:01
Make a pdf look scanned using ImageMagick
# use ImageMagick convert
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf
@pohzipohzi
pohzipohzi / pandas_cheat.py
Created November 16, 2017 10:12
Cheat sheet for the python pandas library
import numpy as np
import pandas as pd
#### creating dataframes, adding and dropping columns
df = pd.DataFrame(np.arange(1,10).reshape(3,3),['A','B','C'],['w','x','y'])
df.columns = ['W','X','Y'] # change column names
df['Z']=df['X']+df['Y'] # new column with values X+Y
df['XX']=df.apply(lambda row: row['X']*2, axis=1) # new column with values twice of column X
df['YY']=1 # new column of ones
@pozil
pozil / applicationEvent.evt
Last active March 5, 2022 15:01
Ligthning - Passing data up and around the component hierarchy via an application component
<aura:event type="APPLICATION">
<aura:attribute name="param" type="String"/>
</aura:event>
@pozil
pozil / componentEvent.evt
Last active June 27, 2021 06:52
Lightning - Passing data up the component hierarchy via a component event
<aura:event type="COMPONENT">
<aura:attribute name="param" type="String"/>
</aura:event>
@pozil
pozil / childComponentWithMethod.cmp
Last active March 13, 2021 20:21
Lightning - Passing data down the component hierarchy via a method
<aura:component >
<aura:method name="myMethod" action="{!c.executeMyMethod}">
<aura:attribute name="param1" type="String"/>
<aura:attribute name="param2" type="String"/>
</aura:method>
</aura:component>
@pozil
pozil / childComponentWithAttribute.cmp
Created March 23, 2017 13:41
Lightning - Passing data down the component hierarchy via attributes and a change handler
<aura:component>
<aura:attribute name="childAttribute" type="String"/>
<aura:handler name="change" value="{!v.childAttribute}" action="{!c.onChildAttributeChange}"/>
<aura:component>
@markhowellsmead
markhowellsmead / css-mixblendmode.js
Created September 28, 2016 14:35
Detect browser support for CSS' mix-blend-mode using JavaScript
if (typeof window.getComputedStyle(document.body).mixBlendMode === 'undefined') {
document.documentElement.className += " mix-blend-mode-no";
}